import Cookies from 'js-cookie'

const TokenKey = 'xinHuaWei_houTai_token'

export function getToken () {
  return Cookies.get(TokenKey)
}

export function setToken (token) {
  return Cookies.set(TokenKey, token, {
    expires: 7 // 单位：天
  })
}

export function removeToken () {
  return Cookies.remove(TokenKey)
}

const userInfoKey = 'xinHuaWei_houTai_userInfo'

export function getUserInfo () {
  return Cookies.get(userInfoKey)
}

export function setUserInfo (userInfo) {
  return Cookies.set(userInfoKey, userInfo, {
    expires: 7 // 单位：天
  })
}

export function removeUserInfo () {
  return Cookies.remove(userInfoKey)
}
